package com.cdtu.mapper;

import com.cdtu.entity.OperationRecord;
import com.cdtu.entity.Resource;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author Sakura
* @description 针对表【resource】的数据库操作Mapper
* @createDate 2023-01-08 12:29:11
* @Entity com.cdtu.entity.Resource
*/

@Mapper
public interface ResourceMapper extends BaseMapper<Resource> {

    List<Resource> queryResourceByCategory(@Param("category") String category);

    int deleteResourceById(String id);

    int saveResource(Resource resource);

    Resource findResourceById(String id);

    int updateResourceById(String id);

    int addStockById(long id, int count);

    int saveRecord(OperationRecord operationRecord);

    Resource findResourceByName(String name);

    List<Resource> queryAll();

    int updateById(Resource resource);

    List<Resource> findByPage(@Param("start") Integer start, @Param("rows") Integer rows);

    //查询总条数
    long findTotal();

    List<Resource> findByCategoryPage(@Param("start") Integer start, @Param("rows") Integer rows, String category);

    //查询总条数
    long findByCategoryTotal(String category);

    List<Resource> findByNamePage(@Param("start") Integer start, @Param("rows") Integer rows, String name);

    //查询总条数
    long findByNameTotal(String name);
}




